﻿namespace WinForms.ControlList.Sales
{
    using Bll.Guest;
    using Bll.Sales;
    using Bll.Systems;
    using Library;
    using Model.Guest;
    using Model.Systems;
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using WinForms;
    using WinForms.Properties;

    public class FrmSelectOrders : Form
    {
        private Button btn_Close;
        private Button btn_Select;
        private Button btnSearch;
        private Button btnSearchHidden;
        private DataGridViewCheckBoxColumn chk_chkItem;
        private IContainer components = null;
        private DataGridViewTextBoxColumn CreateTime;
        private DataGridView DataGridList;
        private DataGridViewImageColumn dataGridViewImageColumn1;
        private DataGridViewImageColumn dataGridViewImageColumn2;
        private DateTimePicker dateTime_BeginTime;
        private DateTimePicker dateTime_EndTime;
        private DataGridViewTextBoxColumn dgAddresses;
        private DataGridViewTextBoxColumn dgChainNum;
        private DataGridViewTextBoxColumn dgCheckMan;
        private DataGridViewTextBoxColumn dgCheckTime;
        private DataGridViewTextBoxColumn dgClearingType;
        private DataGridViewTextBoxColumn dgCostMoney;
        private DataGridViewTextBoxColumn dgCreateTime;
        private DataGridViewTextBoxColumn dgDistrType;
        private DataGridViewTextBoxColumn dgFollowUpDeal;
        private DataGridViewTextBoxColumn dgGuestId;
        private DataGridViewTextBoxColumn dgInvoicingNum;
        private DataGridViewTextBoxColumn dgIsBlackOut;
        private DataGridViewTextBoxColumn dgIsCheck;
        private DataGridViewTextBoxColumn dgIsInvoicing;
        private DataGridViewTextBoxColumn dgIsOut;
        private DataGridViewTextBoxColumn dgIsRequestRetrun;
        private DataGridViewTextBoxColumn dgIsReturn;
        private DataGridViewTextBoxColumn dgIsReview;
        private DataGridViewTextBoxColumn dgIsUseReturn;
        private DataGridViewTextBoxColumn dgLinkMan;
        private DataGridViewTextBoxColumn dgLinkTel;
        private DataGridViewTextBoxColumn dgLogisticsId;
        private DataGridViewTextBoxColumn dgLogisticsName;
        private DataGridViewTextBoxColumn dgLogisticsNum;
        private DataGridViewTextBoxColumn dgNotReason;
        private DataGridViewTextBoxColumn dgOpenType;
        private DataGridViewTextBoxColumn dgOrderNum;
        private DataGridViewTextBoxColumn dgOrdersId;
        private DataGridViewTextBoxColumn dgPaidMoney;
        private DataGridViewTextBoxColumn dgProcurementId;
        private DataGridViewTextBoxColumn dgReason;
        private DataGridViewTextBoxColumn dgRemark;
        private DataGridViewTextBoxColumn dgReturnMoney;
        private DataGridViewTextBoxColumn dgReturnTime;
        private DataGridViewTextBoxColumn dgReviewMan;
        private DataGridViewTextBoxColumn dgReviewTime;
        private DataGridViewTextBoxColumn dgSaleVtag;
        private DataGridViewTextBoxColumn dgSentProMoney;
        private DataGridViewTextBoxColumn dgShipmentsType;
        private DataGridViewTextBoxColumn dgToMeetMoney;
        private DataGridViewTextBoxColumn dgUserId;
        private DataGridViewTextBoxColumn dgZipCode;
        private DataGridViewTextBoxColumn GuestId;
        public const int HTCAPTION = 2;
        private Label label1;
        private Label label2;
        private Label label3;
        private Label label4;
        private Label lbl_CreateTime;
        private Label lbl_GuestName;
        private Label lbl_Idcoument;
        private Label lblWhere;
        private Navigator navigator_Page;
        private DataGridViewTextBoxColumn OrderNum;
        private DataGridViewTextBoxColumn OrdersId;
        private Panel pan_AllPanel;
        private Panel pan_AllPlanes;
        private Panel pan_Bottoms;
        private Panel pan_Dock;
        private Panel pan_DockBottom;
        private Panel pan_DockLeft;
        private Panel pan_DockRight;
        private Panel pan_Lefts;
        private Panel pan_Rights;
        private Panel pan_Top;
        private Panel pan_TopJianGe;
        private Panel pan_TopLeft;
        private Panel pan_TopRight;
        private Panel pan_ZhongJian;
        private Panel pane_TopT;
        private Panel panel_Select;
        private Panel panel1;
        private Panel panel10;
        private Panel panel11;
        private Panel panel12;
        private Panel panel13;
        private Panel panel16;
        private Panel panel18;
        private Panel panel19;
        private Panel panel2;
        private Panel panel20;
        private Panel panel21;
        private Panel panel22;
        private Panel panel23;
        private Panel panel24;
        private Panel panel25;
        private Panel panel3;
        private Panel panel7;
        private Panel panel8;
        private Panel panel9;
        private Panel panel91;
        private Panel PlSearch;
        private DataGridViewTextBoxColumn SaleVtag;
        public const int SC_MOVE = 0xf010;
        public ArrayList selectOrder = new ArrayList();
        private DataGridViewTextBoxColumn ToMeetMoney;
        private TextBox txt_BeginMoney;
        private TextBox txt_EndMoney;
        private TextBox txt_GuestName;
        private TextBox txt_IdDocument;
        private DataGridViewTextBoxColumn UserId;
        public const int WM_SYSCOMMAND = 0x112;

        public FrmSelectOrders()
        {
            this.InitializeComponent();
            base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            base.SetStyle(ControlStyles.UserPaint, true);
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
        }

        private void btn_Close_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btn_Select_Click(object sender, EventArgs e)
        {
            this.selectOrder.Clear();
            string[] strArray = this.GetSelectId(0).Split(new char[] { ',' });
            foreach (string str in strArray)
            {
                if (str != "")
                {
                    try
                    {
                        this.selectOrder.Add(OrdersBll.GetModel(int.Parse(str)));
                    }
                    catch (Exception)
                    {
                    }
                }
            }
            base.DialogResult = DialogResult.OK;
            base.Close();
        }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            string text;
            UserEnt loginUser = PublicAppliction.LoginUser;
            this.lblWhere.Text = " where ChainNum=" + loginUser.ChainNum + " and isout=0";
            if (this.txt_IdDocument.Text != "")
            {
                this.lblWhere.Text = this.lblWhere.Text + " and OrderNum like '%" + this.txt_IdDocument.Text + "%'";
            }
            if ((this.txt_BeginMoney.Text != "") && (this.txt_EndMoney.Text != ""))
            {
                text = this.lblWhere.Text;
                this.lblWhere.Text = text + " and ToMeetMoney>=" + this.txt_BeginMoney.Text + " and ToMeetMoney<=" + this.txt_EndMoney.Text;
            }
            else if ((this.txt_BeginMoney.Text == "") && (this.txt_EndMoney.Text != ""))
            {
                this.lblWhere.Text = this.lblWhere.Text + " and ToMeetMoney<=" + this.txt_EndMoney.Text;
            }
            else if ((this.txt_BeginMoney.Text != "") && (this.txt_EndMoney.Text == ""))
            {
                this.lblWhere.Text = this.lblWhere.Text + " and ToMeetMoney>=" + this.txt_BeginMoney.Text;
            }
            if (this.txt_GuestName.Text != "")
            {
                this.lblWhere.Text = this.lblWhere.Text + " and GuestName like '%" + this.txt_IdDocument.Text + "%'";
            }
            if ((this.dateTime_BeginTime.Value.ToString() != "") && (this.dateTime_EndTime.Value.ToString() != ""))
            {
                text = this.lblWhere.Text;
                this.lblWhere.Text = text + " and CreateTime between #" + this.dateTime_BeginTime.Value.ToString("yyyy-MM-dd 00:00:00") + "# and #" + this.dateTime_EndTime.Value.ToString("yyyy-MM-dd 23:59:59") + "#";
            }
            else if ((this.dateTime_BeginTime.Value.ToString() == "") && (this.dateTime_EndTime.Value.ToString() != ""))
            {
                this.lblWhere.Text = this.lblWhere.Text + " and  CreateTime <=#" + this.dateTime_EndTime.Value.ToString("yyyy-MM-dd 23:59:59") + "#";
            }
            else if ((this.dateTime_BeginTime.Value.ToString() != "") && (this.dateTime_EndTime.Value.ToString() == ""))
            {
                this.lblWhere.Text = this.lblWhere.Text + " and  CreateTime >=#" + this.dateTime_BeginTime.Value.ToString("yyyy-MM-dd 00:00:00") + "#";
            }
            this.DataGrid_bind();
        }

        private void btnSearchHidden_Click(object sender, EventArgs e)
        {
            if (this.PlSearch.Visible)
            {
                this.btnSearchHidden.Text = "显示查询";
                this.PlSearch.Visible = false;
            }
            else
            {
                this.btnSearchHidden.Text = "隐藏查询";
                this.PlSearch.Visible = true;
            }
        }

        protected void DataGrid_bind()
        {
            try
            {
                DataTable dt = new DataTable();
                int pageCurrent = this.navigator_Page.PageCurrent;
                if (this.lblWhere.Text != "")
                {
                    dt = OrdersBll.GetPageList(PublicAppliction.PageCount, pageCurrent, this.lblWhere.Text);
                }
                else
                {
                    dt = OrdersBll.GetPageList(PublicAppliction.PageCount, pageCurrent, "");
                }
                int num2 = GetTableColCount.ReturnTableColCount("Systems", "T_Orders", this.lblWhere.Text);
                this.DataGridList.AutoGenerateColumns = false;
                this.DataZhuanHuan(ref dt);
                this.DataGridList.DataSource = dt;
                this.navigator_Page.DataSource = dt;
                this.navigator_Page.RowCount = num2;
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }

        private void DataGridList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                string s = this.DataGridList.Rows[e.RowIndex].Cells[1].Value.ToString();
                this.selectOrder.Clear();
                this.selectOrder.Add(OrdersBll.GetModel(int.Parse(s)));
                base.DialogResult = DialogResult.OK;
                base.Close();
            }
        }

        protected void DataZhuanHuan(ref DataTable dt)
        {
            dt.Columns["GuestId"].ColumnName = "GuestId1";
            dt.Columns["UserId"].ColumnName = "UserId1";
            dt.Columns["SaleVtag"].ColumnName = "SaleVtag1";
            dt.Columns.Add("GuestId");
            dt.Columns.Add("UserId");
            dt.Columns.Add("SaleVtag");
            foreach (DataRow row in dt.Rows)
            {
                GuestEnt model = GuestBll.GetModel(int.Parse(row["GuestId1"].ToString()));
                if (model != null)
                {
                    row["GuestId"] = model.GuestName;
                }
                DataRow[] rowArray = PublicAppliction.UserDt.Select("userid=" + row["UserId1"].ToString());
                if (rowArray.Length > 0)
                {
                    row["UserId"] = rowArray[0]["UserName"].ToString();
                }
                if (row["SaleVtag1"].ToString() == "0")
                {
                    row["SaleVtag"] = "等待确认";
                }
                else if (row["SaleVtag1"].ToString() == "1")
                {
                    row["SaleVtag"] = "等待收款";
                }
                else if (row["SaleVtag1"].ToString() == "2")
                {
                    row["SaleVtag"] = "已收款";
                }
            }
            dt.Columns.Remove("GuestId1");
            dt.Columns.Remove("UserId1");
            dt.Columns.Remove("SaleVtag1");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmOrdersList_Load(object sender, EventArgs e)
        {
            UserEnt loginUser = PublicAppliction.LoginUser;
            object text = this.lblWhere.Text;
            this.lblWhere.Text = string.Concat(new object[] { text, " where ChainNum=", loginUser.ChainNum, " and isout=1" });
            this.DataGrid_bind();
            this.InitPage();
        }

        private string GetSelectId(int types)
        {
            string str;
            int num;
            if (types == 0)
            {
                str = "";
                for (num = 0; num < this.DataGridList.Rows.Count; num++)
                {
                    if (this.DataGridList.Rows[num].Cells[0].FormattedValue.ToString() == "True")
                    {
                        str = str + this.DataGridList.Rows[num].Cells[1].Value + ",";
                    }
                }
                return str;
            }
            int num2 = 0;
            str = "";
            for (num = 0; num < this.DataGridList.Rows.Count; num++)
            {
                if (this.DataGridList.Rows[num].Cells[0].FormattedValue.ToString() == "True")
                {
                    str = str + this.DataGridList.Rows[num].Cells[1].Value + ",";
                    num2++;
                }
            }
            if (num2 > 1)
            {
                MessageBox.Show("只能选择一项", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return "";
            }
            return str.Replace(",", "");
        }

        private void InitializeComponent()
        {
            DataGridViewCellStyle style = new DataGridViewCellStyle();
            DataGridViewCellStyle style2 = new DataGridViewCellStyle();
            DataGridViewCellStyle style3 = new DataGridViewCellStyle();
            DataGridViewCellStyle style4 = new DataGridViewCellStyle();
            DataGridViewCellStyle style5 = new DataGridViewCellStyle();
            DataGridViewCellStyle style6 = new DataGridViewCellStyle();
            DataGridViewCellStyle style7 = new DataGridViewCellStyle();
            DataGridViewCellStyle style8 = new DataGridViewCellStyle();
            DataGridViewCellStyle style9 = new DataGridViewCellStyle();
            DataGridViewCellStyle style10 = new DataGridViewCellStyle();
            DataGridViewCellStyle style11 = new DataGridViewCellStyle();
            DataGridViewCellStyle style12 = new DataGridViewCellStyle();
            this.panel1 = new Panel();
            this.panel7 = new Panel();
            this.btnSearch = new Button();
            this.panel16 = new Panel();
            this.btnSearchHidden = new Button();
            this.panel3 = new Panel();
            this.panel2 = new Panel();
            this.pan_Dock = new Panel();
            this.pan_AllPanel = new Panel();
            this.pan_AllPlanes = new Panel();
            this.DataGridList = new DataGridView();
            this.chk_chkItem = new DataGridViewCheckBoxColumn();
            this.OrdersId = new DataGridViewTextBoxColumn();
            this.OrderNum = new DataGridViewTextBoxColumn();
            this.GuestId = new DataGridViewTextBoxColumn();
            this.UserId = new DataGridViewTextBoxColumn();
            this.CreateTime = new DataGridViewTextBoxColumn();
            this.ToMeetMoney = new DataGridViewTextBoxColumn();
            this.SaleVtag = new DataGridViewTextBoxColumn();
            this.PlSearch = new Panel();
            this.panel24 = new Panel();
            this.label2 = new Label();
            this.dateTime_EndTime = new DateTimePicker();
            this.dateTime_BeginTime = new DateTimePicker();
            this.panel25 = new Panel();
            this.lbl_CreateTime = new Label();
            this.panel18 = new Panel();
            this.txt_GuestName = new TextBox();
            this.panel21 = new Panel();
            this.lbl_GuestName = new Label();
            this.panel19 = new Panel();
            this.txt_EndMoney = new TextBox();
            this.label4 = new Label();
            this.txt_BeginMoney = new TextBox();
            this.panel20 = new Panel();
            this.label3 = new Label();
            this.panel22 = new Panel();
            this.txt_IdDocument = new TextBox();
            this.panel23 = new Panel();
            this.lbl_Idcoument = new Label();
            this.panel13 = new Panel();
            this.panel10 = new Panel();
            this.panel12 = new Panel();
            this.lblWhere = new Label();
            this.panel11 = new Panel();
            this.navigator_Page = new Navigator();
            this.panel91 = new Panel();
            this.panel_Select = new Panel();
            this.btn_Close = new Button();
            this.btn_Select = new Button();
            this.panel9 = new Panel();
            this.panel8 = new Panel();
            this.pan_TopJianGe = new Panel();
            this.pan_Rights = new Panel();
            this.pan_Lefts = new Panel();
            this.pan_Bottoms = new Panel();
            this.pane_TopT = new Panel();
            this.pan_DockBottom = new Panel();
            this.pan_DockRight = new Panel();
            this.pan_DockLeft = new Panel();
            this.pan_Top = new Panel();
            this.pan_ZhongJian = new Panel();
            this.label1 = new Label();
            this.pan_TopRight = new Panel();
            this.pan_TopLeft = new Panel();
            this.dataGridViewImageColumn1 = new DataGridViewImageColumn();
            this.dataGridViewImageColumn2 = new DataGridViewImageColumn();
            this.panel1.SuspendLayout();
            this.panel7.SuspendLayout();
            this.panel16.SuspendLayout();
            this.pan_Dock.SuspendLayout();
            this.pan_AllPanel.SuspendLayout();
            this.pan_AllPlanes.SuspendLayout();
            ((ISupportInitialize) this.DataGridList).BeginInit();
            this.PlSearch.SuspendLayout();
            this.panel24.SuspendLayout();
            this.panel25.SuspendLayout();
            this.panel18.SuspendLayout();
            this.panel21.SuspendLayout();
            this.panel19.SuspendLayout();
            this.panel20.SuspendLayout();
            this.panel22.SuspendLayout();
            this.panel23.SuspendLayout();
            this.panel10.SuspendLayout();
            this.panel12.SuspendLayout();
            this.panel11.SuspendLayout();
            this.panel_Select.SuspendLayout();
            this.pan_Top.SuspendLayout();
            this.pan_ZhongJian.SuspendLayout();
            base.SuspendLayout();
            this.panel1.BackColor = Color.FromArgb(0xf6, 0xf6, 0xf6);
            this.panel1.Controls.Add(this.panel7);
            this.panel1.Controls.Add(this.panel16);
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Controls.Add(this.panel2);
            this.panel1.Dock = DockStyle.Top;
            this.panel1.Location = new Point(0, 8);
            this.panel1.Name = "panel1";
            this.panel1.Size = new Size(0x3db, 0x1a);
            this.panel1.TabIndex = 1;
            this.panel7.Controls.Add(this.btnSearch);
            this.panel7.Dock = DockStyle.Right;
            this.panel7.Location = new Point(0x329, 3);
            this.panel7.Name = "panel7";
            this.panel7.Size = new Size(0x59, 20);
            this.panel7.TabIndex = 15;
            this.btnSearch.Dock = DockStyle.Right;
            this.btnSearch.Location = new Point(14, 0);
            this.btnSearch.Name = "btnSearch";
            this.btnSearch.Size = new Size(0x4b, 20);
            this.btnSearch.TabIndex = 1;
            this.btnSearch.Text = "查 询";
            this.btnSearch.UseVisualStyleBackColor = true;
            this.btnSearch.Click += new EventHandler(this.btnSearch_Click);
            this.panel16.Controls.Add(this.btnSearchHidden);
            this.panel16.Dock = DockStyle.Right;
            this.panel16.Location = new Point(0x382, 3);
            this.panel16.Name = "panel16";
            this.panel16.Size = new Size(0x59, 20);
            this.panel16.TabIndex = 14;
            this.btnSearchHidden.Dock = DockStyle.Right;
            this.btnSearchHidden.Location = new Point(14, 0);
            this.btnSearchHidden.Name = "btnSearchHidden";
            this.btnSearchHidden.Size = new Size(0x4b, 20);
            this.btnSearchHidden.TabIndex = 0;
            this.btnSearchHidden.Text = "显示查询";
            this.btnSearchHidden.UseVisualStyleBackColor = true;
            this.btnSearchHidden.Click += new EventHandler(this.btnSearchHidden_Click);
            this.panel3.Dock = DockStyle.Bottom;
            this.panel3.Location = new Point(0, 0x17);
            this.panel3.Name = "panel3";
            this.panel3.Size = new Size(0x3db, 3);
            this.panel3.TabIndex = 1;
            this.panel2.Dock = DockStyle.Top;
            this.panel2.Location = new Point(0, 0);
            this.panel2.Name = "panel2";
            this.panel2.Size = new Size(0x3db, 3);
            this.panel2.TabIndex = 0;
            this.pan_Dock.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.pan_Dock.Controls.Add(this.pan_AllPanel);
            this.pan_Dock.Controls.Add(this.pan_DockBottom);
            this.pan_Dock.Controls.Add(this.pan_DockRight);
            this.pan_Dock.Controls.Add(this.pan_DockLeft);
            this.pan_Dock.Dock = DockStyle.Fill;
            this.pan_Dock.Location = new Point(0, 0x20);
            this.pan_Dock.Name = "pan_Dock";
            this.pan_Dock.Size = new Size(0x3f1, 0x201);
            this.pan_Dock.TabIndex = 5;
            this.pan_AllPanel.BackColor = Color.White;
            this.pan_AllPanel.Controls.Add(this.pan_AllPlanes);
            this.pan_AllPanel.Controls.Add(this.pan_Rights);
            this.pan_AllPanel.Controls.Add(this.pan_Lefts);
            this.pan_AllPanel.Controls.Add(this.pan_Bottoms);
            this.pan_AllPanel.Controls.Add(this.pane_TopT);
            this.pan_AllPanel.Dock = DockStyle.Fill;
            this.pan_AllPanel.Location = new Point(1, 0);
            this.pan_AllPanel.Name = "pan_AllPanel";
            this.pan_AllPanel.Size = new Size(0x3ef, 0x200);
            this.pan_AllPanel.TabIndex = 3;
            this.pan_AllPlanes.Controls.Add(this.DataGridList);
            this.pan_AllPlanes.Controls.Add(this.PlSearch);
            this.pan_AllPlanes.Controls.Add(this.panel13);
            this.pan_AllPlanes.Controls.Add(this.panel10);
            this.pan_AllPlanes.Controls.Add(this.panel91);
            this.pan_AllPlanes.Controls.Add(this.panel_Select);
            this.pan_AllPlanes.Controls.Add(this.panel9);
            this.pan_AllPlanes.Controls.Add(this.panel8);
            this.pan_AllPlanes.Controls.Add(this.panel1);
            this.pan_AllPlanes.Controls.Add(this.pan_TopJianGe);
            this.pan_AllPlanes.Dock = DockStyle.Fill;
            this.pan_AllPlanes.Location = new Point(10, 10);
            this.pan_AllPlanes.Name = "pan_AllPlanes";
            this.pan_AllPlanes.Size = new Size(0x3db, 0x1ec);
            this.pan_AllPlanes.TabIndex = 4;
            this.DataGridList.AllowUserToAddRows = false;
            this.DataGridList.AllowUserToDeleteRows = false;
            style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style.BackColor = Color.FromArgb(0xf9, 0xf9, 0xf9);
            this.DataGridList.AlternatingRowsDefaultCellStyle = style;
            this.DataGridList.BackgroundColor = Color.WhiteSmoke;
            this.DataGridList.BorderStyle = BorderStyle.None;
            style2.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style2.BackColor = Color.White;
            style2.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style2.ForeColor = SystemColors.WindowText;
            style2.SelectionBackColor = SystemColors.Highlight;
            style2.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.ColumnHeadersDefaultCellStyle = style2;
            this.DataGridList.Columns.AddRange(new DataGridViewColumn[] { this.chk_chkItem, this.OrdersId, this.OrderNum, this.GuestId, this.UserId, this.CreateTime, this.ToMeetMoney, this.SaleVtag });
            style3.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style3.BackColor = SystemColors.Window;
            style3.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style3.ForeColor = SystemColors.ControlText;
            style3.SelectionBackColor = SystemColors.Highlight;
            style3.SelectionForeColor = SystemColors.HighlightText;
            style3.WrapMode = DataGridViewTriState.False;
            this.DataGridList.DefaultCellStyle = style3;
            this.DataGridList.Dock = DockStyle.Fill;
            this.DataGridList.EnableHeadersVisualStyles = false;
            this.DataGridList.GridColor = Color.FromArgb(0xab, 0xb9, 0x9d);
            this.DataGridList.Location = new Point(0, 0x45);
            this.DataGridList.Name = "DataGridList";
            style4.Alignment = DataGridViewContentAlignment.BottomCenter;
            style4.BackColor = Color.White;
            style4.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style4.ForeColor = SystemColors.WindowText;
            style4.SelectionBackColor = SystemColors.Highlight;
            style4.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.RowHeadersDefaultCellStyle = style4;
            style5.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.DataGridList.RowsDefaultCellStyle = style5;
            this.DataGridList.RowTemplate.Height = 0x17;
            this.DataGridList.Size = new Size(0x3db, 0x15b);
            this.DataGridList.TabIndex = 8;
            this.DataGridList.CellDoubleClick += new DataGridViewCellEventHandler(this.DataGridList_CellDoubleClick);
            style6.NullValue = false;
            this.chk_chkItem.DefaultCellStyle = style6;
            this.chk_chkItem.HeaderText = "选项";
            this.chk_chkItem.IndeterminateValue = "";
            this.chk_chkItem.Name = "chk_chkItem";
            this.chk_chkItem.Width = 50;
            this.chk_chkItem.FalseValue = "false";
            this.chk_chkItem.TrueValue = "true";
            this.OrdersId.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.OrdersId.DataPropertyName = "OrdersId";
            style7.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style7.BackColor = Color.White;
            this.OrdersId.DefaultCellStyle = style7;
            this.OrdersId.HeaderText = "订单id";
            this.OrdersId.Name = "OrdersId";
            this.OrdersId.ReadOnly = true;
            this.OrdersId.Visible = false;
            this.OrderNum.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.OrderNum.DataPropertyName = "OrderNum";
            style8.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style8.BackColor = Color.White;
            this.OrderNum.DefaultCellStyle = style8;
            this.OrderNum.HeaderText = "销售单据";
            this.OrderNum.Name = "OrderNum";
            this.OrderNum.ReadOnly = true;
            this.GuestId.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.GuestId.DataPropertyName = "GuestId";
            style9.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style9.BackColor = Color.White;
            this.GuestId.DefaultCellStyle = style9;
            this.GuestId.HeaderText = "客户";
            this.GuestId.Name = "GuestId";
            this.GuestId.ReadOnly = true;
            this.UserId.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.UserId.DataPropertyName = "UserId";
            style10.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style10.BackColor = Color.White;
            this.UserId.DefaultCellStyle = style10;
            this.UserId.HeaderText = "销售人员";
            this.UserId.Name = "UserId";
            this.UserId.ReadOnly = true;
            this.CreateTime.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.CreateTime.DataPropertyName = "CreateTime";
            style11.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style11.BackColor = Color.White;
            this.CreateTime.DefaultCellStyle = style11;
            this.CreateTime.HeaderText = "销售时间";
            this.CreateTime.Name = "CreateTime";
            this.CreateTime.ReadOnly = true;
            this.ToMeetMoney.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.ToMeetMoney.DataPropertyName = "ToMeetMoney";
            style12.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style12.BackColor = Color.White;
            this.ToMeetMoney.DefaultCellStyle = style12;
            this.ToMeetMoney.HeaderText = "销售金额";
            this.ToMeetMoney.Name = "ToMeetMoney";
            this.ToMeetMoney.ReadOnly = true;
            this.SaleVtag.DataPropertyName = "SaleVtag";
            this.SaleVtag.HeaderText = "销售状态";
            this.SaleVtag.Name = "SaleVtag";
            this.PlSearch.Controls.Add(this.panel24);
            this.PlSearch.Controls.Add(this.panel25);
            this.PlSearch.Controls.Add(this.panel18);
            this.PlSearch.Controls.Add(this.panel21);
            this.PlSearch.Controls.Add(this.panel19);
            this.PlSearch.Controls.Add(this.panel20);
            this.PlSearch.Controls.Add(this.panel22);
            this.PlSearch.Controls.Add(this.panel23);
            this.PlSearch.Dock = DockStyle.Top;
            this.PlSearch.Location = new Point(0, 0x2a);
            this.PlSearch.Name = "PlSearch";
            this.PlSearch.Size = new Size(0x3db, 0x1b);
            this.PlSearch.TabIndex = 6;
            this.PlSearch.Visible = false;
            this.panel24.Controls.Add(this.label2);
            this.panel24.Controls.Add(this.dateTime_EndTime);
            this.panel24.Controls.Add(this.dateTime_BeginTime);
            this.panel24.Dock = DockStyle.Fill;
            this.panel24.Location = new Point(0x2ca, 0);
            this.panel24.Name = "panel24";
            this.panel24.Size = new Size(0x111, 0x1b);
            this.panel24.TabIndex = 0x17;
            this.label2.AutoSize = true;
            this.label2.Location = new Point(0x80, 7);
            this.label2.Name = "label2";
            this.label2.Size = new Size(11, 12);
            this.label2.TabIndex = 2;
            this.label2.Text = "-";
            this.dateTime_EndTime.Location = new Point(0x94, 3);
            this.dateTime_EndTime.Name = "dateTime_EndTime";
            this.dateTime_EndTime.Size = new Size(0x77, 0x15);
            this.dateTime_EndTime.TabIndex = 1;
            this.dateTime_BeginTime.Location = new Point(3, 3);
            this.dateTime_BeginTime.Name = "dateTime_BeginTime";
            this.dateTime_BeginTime.Size = new Size(0x77, 0x15);
            this.dateTime_BeginTime.TabIndex = 0;
            this.panel25.Controls.Add(this.lbl_CreateTime);
            this.panel25.Dock = DockStyle.Left;
            this.panel25.Location = new Point(0x285, 0);
            this.panel25.Name = "panel25";
            this.panel25.Size = new Size(0x45, 0x1b);
            this.panel25.TabIndex = 0x16;
            this.lbl_CreateTime.AutoSize = true;
            this.lbl_CreateTime.Location = new Point(5, 7);
            this.lbl_CreateTime.Name = "lbl_CreateTime";
            this.lbl_CreateTime.Size = new Size(0x3b, 12);
            this.lbl_CreateTime.TabIndex = 0;
            this.lbl_CreateTime.Text = "销售时间:";
            this.panel18.Controls.Add(this.txt_GuestName);
            this.panel18.Dock = DockStyle.Left;
            this.panel18.Location = new Point(0x1f3, 0);
            this.panel18.Name = "panel18";
            this.panel18.Size = new Size(0x92, 0x1b);
            this.panel18.TabIndex = 0x15;
            this.txt_GuestName.Location = new Point(5, 3);
            this.txt_GuestName.Name = "txt_GuestName";
            this.txt_GuestName.Size = new Size(0x89, 0x15);
            this.txt_GuestName.TabIndex = 0;
            this.panel21.Controls.Add(this.lbl_GuestName);
            this.panel21.Dock = DockStyle.Left;
            this.panel21.Location = new Point(430, 0);
            this.panel21.Name = "panel21";
            this.panel21.Size = new Size(0x45, 0x1b);
            this.panel21.TabIndex = 20;
            this.lbl_GuestName.AutoSize = true;
            this.lbl_GuestName.Location = new Point(5, 7);
            this.lbl_GuestName.Name = "lbl_GuestName";
            this.lbl_GuestName.Size = new Size(0x3b, 12);
            this.lbl_GuestName.TabIndex = 0;
            this.lbl_GuestName.Text = "客户姓名:";
            this.panel19.Controls.Add(this.txt_EndMoney);
            this.panel19.Controls.Add(this.label4);
            this.panel19.Controls.Add(this.txt_BeginMoney);
            this.panel19.Dock = DockStyle.Left;
            this.panel19.Location = new Point(0x11c, 0);
            this.panel19.Name = "panel19";
            this.panel19.Size = new Size(0x92, 0x1b);
            this.panel19.TabIndex = 0x13;
            this.txt_EndMoney.Location = new Point(0x55, 3);
            this.txt_EndMoney.Name = "txt_EndMoney";
            this.txt_EndMoney.Size = new Size(0x3a, 0x15);
            this.txt_EndMoney.TabIndex = 2;
            this.txt_EndMoney.KeyPress += new KeyPressEventHandler(this.txt_EndMoney_KeyPress);
            this.label4.AutoSize = true;
            this.label4.Location = new Point(0x44, 6);
            this.label4.Name = "label4";
            this.label4.Size = new Size(11, 12);
            this.label4.TabIndex = 1;
            this.label4.Text = "-";
            this.txt_BeginMoney.Location = new Point(3, 3);
            this.txt_BeginMoney.Name = "txt_BeginMoney";
            this.txt_BeginMoney.Size = new Size(0x3b, 0x15);
            this.txt_BeginMoney.TabIndex = 0;
            this.txt_BeginMoney.KeyPress += new KeyPressEventHandler(this.txt_BeginMoney_KeyPress);
            this.panel20.Controls.Add(this.label3);
            this.panel20.Dock = DockStyle.Left;
            this.panel20.Location = new Point(0xd7, 0);
            this.panel20.Name = "panel20";
            this.panel20.Size = new Size(0x45, 0x1b);
            this.panel20.TabIndex = 0x12;
            this.label3.AutoSize = true;
            this.label3.Location = new Point(6, 6);
            this.label3.Name = "label3";
            this.label3.Size = new Size(0x3b, 12);
            this.label3.TabIndex = 0;
            this.label3.Text = "销售金额:";
            this.panel22.Controls.Add(this.txt_IdDocument);
            this.panel22.Dock = DockStyle.Left;
            this.panel22.Location = new Point(0x45, 0);
            this.panel22.Name = "panel22";
            this.panel22.Size = new Size(0x92, 0x1b);
            this.panel22.TabIndex = 0x11;
            this.txt_IdDocument.Location = new Point(5, 3);
            this.txt_IdDocument.Name = "txt_IdDocument";
            this.txt_IdDocument.Size = new Size(0x89, 0x15);
            this.txt_IdDocument.TabIndex = 0;
            this.panel23.Controls.Add(this.lbl_Idcoument);
            this.panel23.Dock = DockStyle.Left;
            this.panel23.Location = new Point(0, 0);
            this.panel23.Name = "panel23";
            this.panel23.Size = new Size(0x45, 0x1b);
            this.panel23.TabIndex = 0x10;
            this.lbl_Idcoument.AutoSize = true;
            this.lbl_Idcoument.Location = new Point(5, 6);
            this.lbl_Idcoument.Name = "lbl_Idcoument";
            this.lbl_Idcoument.Size = new Size(0x3b, 12);
            this.lbl_Idcoument.TabIndex = 0;
            this.lbl_Idcoument.Text = "单据编号:";
            this.panel13.Dock = DockStyle.Bottom;
            this.panel13.Location = new Point(0, 0x1a0);
            this.panel13.Name = "panel13";
            this.panel13.Size = new Size(0x3db, 10);
            this.panel13.TabIndex = 5;
            this.panel10.BackColor = Color.FromArgb(0xca, 0xc9, 0xce);
            this.panel10.Controls.Add(this.panel12);
            this.panel10.Controls.Add(this.panel11);
            this.panel10.Dock = DockStyle.Bottom;
            this.panel10.Location = new Point(0, 0x1aa);
            this.panel10.Name = "panel10";
            this.panel10.Size = new Size(0x3db, 0x1a);
            this.panel10.TabIndex = 4;
            this.panel12.Controls.Add(this.lblWhere);
            this.panel12.Dock = DockStyle.Fill;
            this.panel12.Location = new Point(0, 0);
            this.panel12.Name = "panel12";
            this.panel12.Size = new Size(0x21e, 0x1a);
            this.panel12.TabIndex = 1;
            this.lblWhere.AutoSize = true;
            this.lblWhere.Dock = DockStyle.Right;
            this.lblWhere.Location = new Point(0x21e, 0);
            this.lblWhere.Name = "lblWhere";
            this.lblWhere.Size = new Size(0, 12);
            this.lblWhere.TabIndex = 0;
            this.lblWhere.Visible = false;
            this.panel11.Controls.Add(this.navigator_Page);
            this.panel11.Dock = DockStyle.Right;
            this.panel11.Location = new Point(0x21e, 0);
            this.panel11.Name = "panel11";
            this.panel11.Size = new Size(0x1bd, 0x1a);
            this.panel11.TabIndex = 0;
            this.navigator_Page.Dock = DockStyle.Bottom;
            this.navigator_Page.Location = new Point(0, 8);
            this.navigator_Page.Name = "navigator_Page";
            this.navigator_Page.PageSize = 20;
            this.navigator_Page.RowCount = 0;
            this.navigator_Page.Size = new Size(0x1bd, 0x12);
            this.navigator_Page.TabIndex = 0;
            this.navigator_Page.OnLoadViewStatus += new Navigator.LoadViewStatusHandler(this.navigator_Page_OnLoadViewStatus);
            this.panel91.Dock = DockStyle.Bottom;
            this.panel91.Location = new Point(0, 0x1c4);
            this.panel91.Name = "panel91";
            this.panel91.Size = new Size(0x3db, 5);
            this.panel91.TabIndex = 3;
            this.panel_Select.Controls.Add(this.btn_Close);
            this.panel_Select.Controls.Add(this.btn_Select);
            this.panel_Select.Dock = DockStyle.Bottom;
            this.panel_Select.Location = new Point(0, 0x1c9);
            this.panel_Select.Name = "panel_Select";
            this.panel_Select.Size = new Size(0x3db, 30);
            this.panel_Select.TabIndex = 3;
            this.btn_Close.Location = new Point(0x240, 4);
            this.btn_Close.Name = "btn_Close";
            this.btn_Close.Size = new Size(0x4b, 0x17);
            this.btn_Close.TabIndex = 3;
            this.btn_Close.Text = "关 闭";
            this.btn_Close.UseVisualStyleBackColor = true;
            this.btn_Close.Click += new EventHandler(this.btn_Close_Click);
            this.btn_Select.Location = new Point(0x14f, 4);
            this.btn_Select.Name = "btn_Select";
            this.btn_Select.Size = new Size(0x4b, 0x17);
            this.btn_Select.TabIndex = 2;
            this.btn_Select.Text = "选 择";
            this.btn_Select.UseVisualStyleBackColor = true;
            this.btn_Select.Click += new EventHandler(this.btn_Select_Click);
            this.panel9.Dock = DockStyle.Bottom;
            this.panel9.Location = new Point(0, 0x1e7);
            this.panel9.Name = "panel9";
            this.panel9.Size = new Size(0x3db, 5);
            this.panel9.TabIndex = 3;
            this.panel8.Dock = DockStyle.Top;
            this.panel8.Location = new Point(0, 0x22);
            this.panel8.Name = "panel8";
            this.panel8.Size = new Size(0x3db, 8);
            this.panel8.TabIndex = 2;
            this.pan_TopJianGe.Dock = DockStyle.Top;
            this.pan_TopJianGe.Location = new Point(0, 0);
            this.pan_TopJianGe.Name = "pan_TopJianGe";
            this.pan_TopJianGe.Size = new Size(0x3db, 8);
            this.pan_TopJianGe.TabIndex = 0;
            this.pan_Rights.Dock = DockStyle.Right;
            this.pan_Rights.Location = new Point(0x3e5, 10);
            this.pan_Rights.Name = "pan_Rights";
            this.pan_Rights.Size = new Size(10, 0x1ec);
            this.pan_Rights.TabIndex = 3;
            this.pan_Lefts.Dock = DockStyle.Left;
            this.pan_Lefts.Location = new Point(0, 10);
            this.pan_Lefts.Name = "pan_Lefts";
            this.pan_Lefts.Size = new Size(10, 0x1ec);
            this.pan_Lefts.TabIndex = 2;
            this.pan_Bottoms.Dock = DockStyle.Bottom;
            this.pan_Bottoms.Location = new Point(0, 0x1f6);
            this.pan_Bottoms.Name = "pan_Bottoms";
            this.pan_Bottoms.Size = new Size(0x3ef, 10);
            this.pan_Bottoms.TabIndex = 1;
            this.pane_TopT.Dock = DockStyle.Top;
            this.pane_TopT.Location = new Point(0, 0);
            this.pane_TopT.Name = "pane_TopT";
            this.pane_TopT.Size = new Size(0x3ef, 10);
            this.pane_TopT.TabIndex = 0;
            this.pan_DockBottom.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockBottom.Dock = DockStyle.Bottom;
            this.pan_DockBottom.Location = new Point(1, 0x200);
            this.pan_DockBottom.Name = "pan_DockBottom";
            this.pan_DockBottom.Size = new Size(0x3ef, 1);
            this.pan_DockBottom.TabIndex = 2;
            this.pan_DockRight.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockRight.Dock = DockStyle.Right;
            this.pan_DockRight.Location = new Point(0x3f0, 0);
            this.pan_DockRight.Name = "pan_DockRight";
            this.pan_DockRight.Size = new Size(1, 0x201);
            this.pan_DockRight.TabIndex = 1;
            this.pan_DockLeft.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockLeft.Dock = DockStyle.Left;
            this.pan_DockLeft.Location = new Point(0, 0);
            this.pan_DockLeft.Name = "pan_DockLeft";
            this.pan_DockLeft.Size = new Size(1, 0x201);
            this.pan_DockLeft.TabIndex = 0;
            this.pan_Top.Controls.Add(this.pan_ZhongJian);
            this.pan_Top.Controls.Add(this.pan_TopRight);
            this.pan_Top.Controls.Add(this.pan_TopLeft);
            this.pan_Top.Dock = DockStyle.Top;
            this.pan_Top.Location = new Point(0, 0);
            this.pan_Top.Name = "pan_Top";
            this.pan_Top.Size = new Size(0x3f1, 0x20);
            this.pan_Top.TabIndex = 4;
            this.pan_ZhongJian.BackgroundImage = Resources.uc_title_2;
            this.pan_ZhongJian.Controls.Add(this.label1);
            this.pan_ZhongJian.Dock = DockStyle.Fill;
            this.pan_ZhongJian.Location = new Point(0x1f, 0);
            this.pan_ZhongJian.Name = "pan_ZhongJian";
            this.pan_ZhongJian.Size = new Size(0x3cd, 0x20);
            this.pan_ZhongJian.TabIndex = 2;
            this.label1.AutoSize = true;
            this.label1.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.label1.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.label1.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.label1.Location = new Point(6, 8);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x3f, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "销售管理";
            this.pan_TopRight.BackgroundImage = Resources.uc_title_1;
            this.pan_TopRight.Dock = DockStyle.Right;
            this.pan_TopRight.Location = new Point(0x3ec, 0);
            this.pan_TopRight.Name = "pan_TopRight";
            this.pan_TopRight.Size = new Size(5, 0x20);
            this.pan_TopRight.TabIndex = 1;
            this.pan_TopLeft.BackgroundImage = Resources.uc_title;
            this.pan_TopLeft.Dock = DockStyle.Left;
            this.pan_TopLeft.Location = new Point(0, 0);
            this.pan_TopLeft.Name = "pan_TopLeft";
            this.pan_TopLeft.Size = new Size(0x1f, 0x20);
            this.pan_TopLeft.TabIndex = 0;
            this.dataGridViewImageColumn1.HeaderText = "编辑";
            this.dataGridViewImageColumn1.Image = Resources.EditBtn;
            this.dataGridViewImageColumn1.Name = "dataGridViewImageColumn1";
            this.dataGridViewImageColumn1.Width = 60;
            this.dataGridViewImageColumn2.HeaderText = "删除";
            this.dataGridViewImageColumn2.Image = Resources.DeleteBtn;
            this.dataGridViewImageColumn2.Name = "dataGridViewImageColumn2";
            this.dataGridViewImageColumn2.Width = 60;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x3f1, 0x221);
            base.Controls.Add(this.pan_Dock);
            base.Controls.Add(this.pan_Top);
            base.FormBorderStyle = FormBorderStyle.None;
            base.Name = "FrmSelectOrders";
            base.ShowInTaskbar = false;
            this.Text = "FrmChain";
            base.Load += new EventHandler(this.FrmOrdersList_Load);
            this.panel1.ResumeLayout(false);
            this.panel7.ResumeLayout(false);
            this.panel16.ResumeLayout(false);
            this.pan_Dock.ResumeLayout(false);
            this.pan_AllPanel.ResumeLayout(false);
            this.pan_AllPlanes.ResumeLayout(false);
            ((ISupportInitialize) this.DataGridList).EndInit();
            this.PlSearch.ResumeLayout(false);
            this.panel24.ResumeLayout(false);
            this.panel24.PerformLayout();
            this.panel25.ResumeLayout(false);
            this.panel25.PerformLayout();
            this.panel18.ResumeLayout(false);
            this.panel18.PerformLayout();
            this.panel21.ResumeLayout(false);
            this.panel21.PerformLayout();
            this.panel19.ResumeLayout(false);
            this.panel19.PerformLayout();
            this.panel20.ResumeLayout(false);
            this.panel20.PerformLayout();
            this.panel22.ResumeLayout(false);
            this.panel22.PerformLayout();
            this.panel23.ResumeLayout(false);
            this.panel23.PerformLayout();
            this.panel10.ResumeLayout(false);
            this.panel12.ResumeLayout(false);
            this.panel12.PerformLayout();
            this.panel11.ResumeLayout(false);
            this.panel_Select.ResumeLayout(false);
            this.pan_Top.ResumeLayout(false);
            this.pan_ZhongJian.ResumeLayout(false);
            this.pan_ZhongJian.PerformLayout();
            base.ResumeLayout(false);
        }

        private void InitPage()
        {
            this.navigator_Page.PageSize = PublicAppliction.PageCount;
            this.navigator_Page.DataContainer = this.DataGridList;
            this.navigator_Page.Init();
        }

        private void navigator_Page_OnLoadViewStatus()
        {
            this.DataGrid_bind();
            this.navigator_Page.PageSize = PublicAppliction.PageCount;
            this.navigator_Page.DataContainer = this.DataGridList;
            this.navigator_Page.DataBind();
        }

        private void pan_TopLeft_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void pan_ZhongJian_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        [DllImport("user32.dll")]
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
        private void txt_BeginMoney_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((((e.KeyChar < '0') || (e.KeyChar > '9')) && (e.KeyChar != '\b')) && (e.KeyChar != '.'))
            {
                e.Handled = true;
            }
        }

        private void txt_EndMoney_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((((e.KeyChar < '0') || (e.KeyChar > '9')) && (e.KeyChar != '\b')) && (e.KeyChar != '.'))
            {
                e.Handled = true;
            }
        }
    }
}

